package com.share.netdisk.file.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.share.constant.Result;
import com.share.netdisk.file.pojo.File;
import com.share.netdisk.file.pojo.UserFile;
import org.springframework.http.ResponseEntity;
import org.springframework.web.multipart.MultipartFile;

import javax.servlet.http.HttpServletResponse;

public interface FileService extends IService<File> {

    Result add(MultipartFile file, Long parentId);
    boolean insertHomeFile(UserFile userFile);

    ResponseEntity<byte[]> download(Long fileId, HttpServletResponse response);

    Result removeFileById(Long fileId);

    Result fileList(Long fileId, Long parentId,int pageNum, int pageSize);

    Result moveFile(Long srcFileId, Long dstFileId);

    Result copyFile(Long srcFileId, Long dstFileId);

    Result renameFile(Long fileId, String newName);

    Result createFile(String fileName, Long parentId);

    Result searchFile(String fileName, Long parentId,int pageNum, int pageSize);
}
